package net.ulrice.mdls.server;

import net.ulrice.mdls.services.MdlsService;

import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TThreadPoolServer;
import org.apache.thrift.server.TThreadPoolServer.Args;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class MdlsServer {

	private static final Logger LOG = LoggerFactory.getLogger(MdlsServer.class);
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void main(String[] args) throws Exception {
		MdlsService.Processor processor = new MdlsService.Processor(new MdlsServerFacadeHandler());			
		TServerTransport serverTransport = new TServerSocket(9090);		
		TServer server = new TThreadPoolServer(new Args(serverTransport).processor(processor));		
		
		LOG.info("Mdls-Server started at port 9090");
		server.serve();
	}	
}
